package com.tengju.settlement.domain.model.depository;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author: 大木
 * @date: 2021/12/6 4:24 下午
 */
@AllArgsConstructor
@Getter
public enum VerifyType {

    SMALL_AMOUNT_VERIFY(1, 1,"小额鉴权"),
    UNION_PAY_VERIFY(2,2,"银联鉴权"),
    ;

    Integer innerVal;
    Integer financeVal;
    String desc;

    public static VerifyType ofInnerVal(Integer innerCode) {
        if (innerCode == null) {
            return null;
        }
        for (VerifyType type : values()) {
            if (type.innerVal.equals(innerCode)) {
                return type;
            }
        }
        return null;
    }

    public static VerifyType ofFinanceVal(Integer financeCode) {
        if (financeCode == null) {
            return null;
        }
        for (VerifyType type : values()) {
            if (type.financeVal.equals(financeCode)) {
                return type;
            }
        }
        return null;
    }

}
